package org.levi.demo.controller;

import org.levi.demo.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/resume")
public class ResumeController {

    @Autowired
    private ResumeService resumeService;

    @GetMapping("/openState/{userId}")
    public Integer findDefaultResumeState(@PathVariable Long userId) throws InterruptedException {

        // 模拟处理超时
        /*try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }*/
        System.out.println("====>>>>>>>>>>>>>>我是8081，访问到我这里了......");
        //Thread.sleep(3000);
        return resumeService.checkResumeOpenStatusByUserId(userId);
    }

}
